
#include "./capstone/capstone.h"
int main()
{
	csh handle;
	size_t count;
	uint32_t size = 2;
	uint64_t address = 0;
	cs_insn* insn;
	unsigned char code[300] = { 0x8B, 0xEC };
	if (cs_open(CS_ARCH_X86, CS_MODE_32, &handle))
	{
		printf("ERROR: Failed to initialize engine!\n");
		return 0;
	}
	count = cs_disasm(handle, code, size, address, 0, &insn);
	if (count)
	{
		for (int j = 0; j < count; j++)
		{
			printf("%s\t%s ;%08x  %08x", insn[j].mnemonic, insn[j].op_str);
		}
	}
	else
	{
		printf("error");
	}
	printf("\n");
	cs_close(&handle);
	return 0;
}